package com.itmei.springaopanno.controller;

import com.itmei.springaopanno.annotation.Log;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author itmei
 * @Date 2022/12/19
 * @description: 商品控制层
 * @Title: GoodsController
 * @Package com.itmei.springaopanno.controller
 */
@Controller
@RequestMapping("goods")
public class GoodsController {
    /**
     * 通过商品id修改商品名称
     * @param goodsId
     * @param name
     */
    @Log(title = "更新商品名称")
    @PostMapping("/updateGoods")
    public void updateGoods(String goodsId,String name){
        //修改商品id修改商品名称代码
        System.out.println("商品ID："+goodsId);
        System.out.println("商品名称："+name);
        System.out.println("updateGoods方法更新商品成功");
    }

    /**
     * 保存商品
     * @param name
     * @param weight
     */
    @Log(title = "保存商品")
    @PostMapping("/saveGoods")
    public void saveGoods(String name,String weight){
        //修改商品id修改商品名称代码
        System.out.println("商品名称："+name);
        System.out.println("商品重量："+weight);
        System.out.println("保存商品成功");
    }
}
